package com.webside.wap.common.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.webside.wap.common.mapper.BdictionaryMapper;
import com.webside.wap.common.model.Bdictionary;
import com.webside.wap.common.service.BdictionaryService;
@Service("BdictionaryServiceimpl")
public class BdictionaryServiceImpl implements BdictionaryService {
	@Autowired
	BdictionaryMapper bdictionaryDao;
	
	/**
	 * 通过查询code返回Bdictionary获取type等需要的属性 
	 * @param code
	 * @return
	 */
	public List<Bdictionary> queryByCode(String code) {
		return bdictionaryDao.queryByCode(code);
	}
	
	/**
	 * 通过传递的 Bdictionary对象的code type进行查询
	 * 通过传入的sort字段进行升序排序（从小到大）
	 * @param bdictionary
	 * @return
	 */
	public List<Bdictionary> queryByCodeAndTypeAsc(Bdictionary bdictionary, String sort) {
		return bdictionaryDao.queryByTypeAndCodeAsc(bdictionary,sort);
	}
	
	/**
	 * 通过传递的 Bdictionary对象的code type进行查询
	 * 通过传入的sort字段进行降序排序（从小到大）
	 * @param bdictionary
	 * @return
	 */
	public List<Bdictionary> queryByCodeAndTypeDesc(Bdictionary bdictionary, String sort) {
		return bdictionaryDao.queryByTypeAndCodeDesc(bdictionary,sort);
	}

}
